import { defineConfig } from 'umi';

export default defineConfig({
    layout: {
        // 支持任何不需要 dom 的
        // https://procomponents.ant.design/components/layout#prolayout
        name: '管理后台',
        locale: true,
        layout: 'side',
    },
    nodeModulesTransform: {
        type: 'none',
    },
    proxy: {
        '/api': {
            'target': 'http://127.0.0.1:7001/',
            'changeOrigin': true,
            'pathRewrite': { '^/api': '' },
        },
    },
    routes: [
        {
            path: '/home', component: '@/pages/index', name: "工作台",
        },
        {
            path: '/demo', name: "文章管理", routes: [
                {
                    path: '/demo/allaricle', component: '@/pages/Demo/Views/Allarcile.tsx', name: "所有文章"
                },
                {
                    path: "/demo/classfly", component: '@/pages/Demo/Views/Classfly.tsx', name: "分类管理"
                },
                {
                    path: "/demo/taglly", component: '@/pages/Demo/Views/Taglly.tsx', name: "标签管理"
                },
            ]
        },
        {
            path: '/home/article', component: '@/pages/VIews/Article/Article.tsx',
        },
        {
            path: "/home/yeguan", component: '@/pages/VIews/Yeguan/Yeguan.tsx', name: '页面管理'
        },
        {
            path: '/home/notebook', component: '@/pages/VIews/Notebook/Notebook.tsx', name: '知识小册'
        },
        {
            path: '/home/poster', component: '@/pages/VIews/Posters/Posters.tsx', name: '海报管理'
        },
        {
            path: '/home/comment', component: '@/pages/VIews/Comment/Comment.tsx', name: '评论管理'
        }
        ,
        {
            path: '/home/email', component: '@/pages/VIews/Email/Email.tsx', name: '邮件管理'
        }
        ,
        {
            path: '/home/file', component: '@/pages/VIews/File/File.tsx', name: '文件管理'
        }
        ,
        {
            path: '/home/search', component: '@/pages/VIews/Search/Search.tsx', name: '搜索记录'
        },
        {
            path: '/home/status', component: '@/pages/VIews/Status/Status.tsx', name: '访问统计'
        },
        {
            path: '/home/user', component: '@/pages/VIews/User/User.tsx', name: '用户管理'
        }
        ,
        {
            path: '/home/system', component: '@/pages/VIews/System/System.tsx', name: '系统设置'
        }

    ],
    fastRefresh: {},
});
